/*
	merge and find set
*/
#ifndef _MFSET_H_
#define _MFSET_H_

#define MAX_TREE_SIZE 100
typedef int TElemType;
typedef struct PTNode {
	TElemType data;
	int parent;			//position of parent
	int count;
}PTNode;

typedef struct {
	PTNode nodes[MAX_TREE_SIZE+1];
	int n;		//number of node
}PTree;

typedef PTree MFSet;

int find_mfset(const MFSet &S, int i);
void mix_mfset(MFSet &S, int i, int j);
void init_mfset(MFSet &S, int n);
#endif